#
# ParameterWeaver: a code generator to handle command line parameters
# and configuration files for C/C++/Fortran/R/Octave
# Copyright (C) 2013 Geert Jan Bex <geertjan.bex@uhasselt.be>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
F90 = gfortran
FFLAGS = -O2
LDFLAGS =
LIBS = -lm

SRCS = cl_params.f90 main.f90
APPL = cl_params config_params

all: $(APPL)

cl_params: cl_params.f90 main.f90
	$(F90) $(FFLAGS) -o $@ cl_params.f90 main.f90 $(LDFLAGS) $(LIBS)

config_params: cl_params.f90 main_config.f90
	$(F90) $(FFLAGS) -o $@ cl_params.f90 main_config.f90 $(LDFLAGS) $(LIBS)

cl_params.f90: param_defs.txt
	weave -l Fortran -d $<

clean:
	rm -f cl_params.f90 *.mod *.o $(APPL) core output.txt

